package com.fwj.config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

public class Constants {

	private static Logger logger = Logger.getLogger(Constants.class);  
	public static String syn_datafile;//未处理同步数据文件
	public static String syn_datafile_his = "";//已处理同步数据文件
	public static String sh_data;//未处理F5可执行脚本
	public static String f5_datafile;//存放F5设备配置文件
	public static String sh_his;  //sh文件迁移目录
	public static String private_key_path;  //私钥位置
	private static InputStream inputStream = null;
	static{
		inputStream = Thread.currentThread()
				.getContextClassLoader()
				.getResourceAsStream("config.properties");
		Properties props = new Properties();
		try {
			
			props.load(inputStream);
			Constants.syn_datafile = (String) props.get("syn_datafile");
			Constants.syn_datafile_his = (String) props.get("syn_datafile_his");
			Constants.sh_data = (String) props.get("sh_data");
			Constants.f5_datafile = (String) props.get("f5_datafile");
			Constants.sh_his = (String) props.get("sh_his");
			Constants.private_key_path = (String) props.get("private_key_path");

		} catch (IOException e) {
			logger.error(e.getMessage());
			e.printStackTrace();
		} finally{
			try {
				inputStream.close();
			} catch (IOException e) {
				logger.error(e.getMessage());
				e.printStackTrace();
			}
		}
	}


}
